package com.ymatou.iapi.csim.parameter;

import java.util.List;

import com.google.common.collect.Lists;

public class PagingResult<T> {
	 private int recordCount;

	    private List<T> records;

	    public int getRecordCount() {
	        return recordCount;
	    }

	    public void setRecordCount(int recordCount) {
	        this.recordCount = recordCount;
	    }

	    public List<T> getRecords() {
	        return records;
	    }

	    public void setRecords(List<T> records) {
	        this.records = records;
	    }

	    public static <T> PagingResult<T> of(int recordCount, List<T> records){
	        PagingResult<T> result = new PagingResult<T>();
	        result.setRecordCount(recordCount);
	        result.setRecords(records);
	        return result;
	    }

	    public static <T> PagingResult<T> ofEmpty(int recordCount){
	        return of(recordCount, Lists.newArrayList());
	    }
}
